/*
 * iic.h
 *
 *  Created on: 2014-3-9
 *      Author: Rome
 */

#ifndef IIC_H_
#define IIC_H_
#include "altera_avalon_pio_regs.h"
#include "system.h"
#define   OUT    1
#define   IN     0

#define time	30

typedef struct _I2C
{
	unsigned int sda;
	unsigned int scl;
}I2C;


void I2C_Start(I2C i2c);
void I2C_Stop(I2C i2c);
void I2C_Ack(I2C i2c);
void Check_Ack(I2C i2c);
void I2C_Nack(I2C i2c);
unsigned char I2C_Receive_Byte(I2C i2c);
void I2C_Send_Byte(I2C i2c, char d);

#endif /* IIC_H_ */
